<template>
    <li :class="newsItem.container">
      <p :class="newsItem.title">
        <template v-if="content.content.is_json">
          <router-link :to="{name:'articlePage',params: {id: content.content.msg_id}}">{{content.content.title}}</router-link>
        </template>
        <template v-else>
          <a :href="content.content.source_link" target="_blank">{{content.content.title}}</a>
        </template>
      </p>
      <p :class="newsItem.des">{{content.content.summary}}</p>
      <div>
        <span :class="newsItem.note">热门话题</span>
        <span :class="newsItem.times">{{content.content.date | time}}</span>
        <span :class="newsItem.source">{{content.content.source}}</span>
      </div>
    </li>
</template>

<script>
export default {
  name: "newsItme",
  props: {
    content: {
      required: true
    }
  }
}
</script>

<style lang="scss" module="newsItem">
.container {
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding:40px;
  .title{
    font-size:32px;
    color: #33383e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 45px;
    margin-bottom:30px;
    a:visited{
      color:#999;
    }
  }
  .des{
    font-size:28px;
    color: #878787;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-height: 45px;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
  }
  .note{
    display: inline-block;
    padding:0 10px;
    background-color: #e43112;
    color:#fff;
    font-size: 28px;
    line-height: 48px;
    margin-right:32px;
  }
  .times,.source{
    font-size: 24px;
    color: #aaaaaa;
  }
  .times{
    margin-right:10px;
  }
  .source:before{
    content:'|';
    display: inline-block;
    margin-right:20px;
  }
}
</style>
